﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;
using Easy.Operation;
using Easy.BLL;

namespace Easy.Web.Service.Privilege
{
    /// <summary>
    /// 2016.4.29 张雨奇
    /// </summary>
    public class UpdateBusinessUnit : BaseHttpHandler
    {

        public override void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            String BusinessUpdateInfo = context.Request["BusinessUnit"];
            String BusinessUpdateOption = context.Request["OperationTypeCode"];
            JavaScriptSerializer JSONHelper = new JavaScriptSerializer();
            Easy.Model.BusinessUnit BusinessUnit_From_Json = JSONHelper.Deserialize<Easy.Model.BusinessUnit>(BusinessUpdateInfo);
            ResultClass result=new ResultClass();
            BusinessUnitBLL Processor = new BusinessUnitBLL();
            ResultClass rc = new ResultClass();
            if (!Processor.ModifyBusinessUnitRouter(BusinessUpdateOption, BusinessUnit_From_Json, CurrentUserId))
            {
                rc.Remark = "失败";
                rc.Result = 0;
            }
            else
            {
                rc.Remark = "成功";
                rc.Result = 1;
            }
            context.Response.Write(rc.ToJson());
        }

    }
}